package com.yhj.reggie.mapper;

import com.yhj.reggie.dto.OrdersDto;
import com.yhj.reggie.entity.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderMapper {

    @Insert("insert into orders values(#{id},#{number},#{status},#{userId}," +
            "#{addressBookId},#{orderTime},#{checkoutTime},#{payMethod},#{amount}," +
            "#{remark},#{phone},#{address},#{userName},#{consignee})")
    void save(Orders orders);

    //查询所有订单
    List<OrdersDto> findAll(@Param("userId") Long userId);
}
